{% extends 'front/base.html' %}
{% block css %}
    <link href="{{ url_for('static', filename='simple/css/info.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
    <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
{% endblock %}
{% block content %}
    <div class="post-list">
    {% if post_list %}
        {% for post in post_list %}
            <div class="infosbox">
                <div class="newsview">
                  <h3 class="news_title">{{post.title |safe}}</h3>
                  <div class="bloginfo">
                    <ul>
                      <li class="timer">时间：{{ moment(post.create_time.date()).format('LL') }}</li>
                    </ul>
                  </div>
                  <div class="news_con" style="line-height: 1.8rem;padding-bottom: 2rem;margin-top: 1.5rem;">
                      {{ post.content | safe}}
                  </div>
                </div>
            </div>
        {% endfor %}
{#    {{ render_page(pagination, endpoint, club_id)}}#}
        {%  if pagination.pages > 1 %}
            <div class="infosbox" style="padding-bottom: 2rem;">
            <ul class="pagelist">
            <li{% if not pagination.has_prev %} class="disabled"{% endif %}>
                <a href="{% if pagination.has_prev %}{{ url_for(endpoint, club_id=club_id,
                    page = pagination.page - 1) }}{% else %}#{% endif %}">
                    &laquo;
                </a>
            </li>
            {% for p in pagination.iter_pages() %}
                {% if p %}
                    {% if p == pagination.page %}
                    <li class="active">
                        <a href="{{ url_for(endpoint, club_id=club_id, page = p) }}">{{ p }}</a>
                    </li>
                    {% else %}
                    <li>
                        <a href="{{ url_for(endpoint, club_id=club_id, page = p) }}">{{ p }}</a>
                    </li>
                    {% endif %}
                {% else %}
                <li class="disabled"><a href="#">&hellip;</a></li>
                {% endif %}
            {% endfor %}
            <li{% if not pagination.has_next %} class="disabled"{% endif %}>
                <a href="{% if pagination.has_next %}{{ url_for(endpoint, club_id=club_id,
                    page = pagination.page + 1) }}{% else %}#{% endif %}">
                    &raquo;
                </a>
            </li>
        </ul>
            </div>
        {% endif %}
    {% else %}
        <div class="infosbox">
            <div class="newsview">
              <div class="no-content" style="line-height: 1.8rem;padding-bottom: 2rem;margin-top: 1.5rem;">
                  暂无分享内容
              </div>
            </div>
        </div>
    {% endif %}
  </div>
{% endblock %}